#ifndef EASYFACTORY_H
#define EASYFACTORY_H

#include <iostream>
using namespace std;

class Fruit{
public:
    virtual~Fruit()=0;
    virtual void getFruit()=0;
};

class Banana:public Fruit{
public:
    void getFruit(){
        cout<<"香蕉"<<endl;
    }
};

class Pear:public Fruit{
    // Fruit interface
public:
    void getFruit(){
        cout<<"梨子"<<endl;
    }
};

//工厂不是一个抽象工厂
/**
 * @brief The Factory class
 */
class Factory{
    static Fruit* Create(char *name){
        Fruit *fruit=NULL;
        if(strcmp(name,"pear")==0){
            fruit=new Pear;
        }else if(strcmp(name,"banana")==0){
            fruit=new Banana;
        }else{

        }

    }
};


#endif // EASYFACTORY_H
